# -*- coding:utf-8 -*-
# @Time:2023/1/5 16:41
# @Author: cevent
# @name=urls

from django.conf.urls import url, include
# from .views import RegisterView
# 将views的所有配置class都导入
from . import views

# 定义了命名空间，每个app都要设置app_name
app_name = 'users'

urlpatterns = [
    # 注册页面获取，命名空间：reverse(users:register) == '/register/'，路由改变，页面指向不变
    url(r'^register/$', views.RegisterView.as_view(), name='register'),

    # 用户名重复，这则获取参数：(?P<参数名> 正则)
    url(r'^username/(?P<username>[a-zA-Z0-9_-]{3,20})/count/$', views.UsernameCountView.as_view()),
    # 手机号重复
    url(r'^mobile/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view()),

    # 用户登录页获取
    url(r'^login/$', views.LoginView.as_view(), name='login'),

    # 用户退出登录,如果不配置命名空间，也可以在href定义掉站='/loginout/'
    url(r'^loginout/$', views.LoginOutView.as_view(), name='loginOut'),

    # 判断用户是否登录
    url(r'^userInfo/$', views.UserInfoView.as_view(), name='userInfo'),

    # 绑定QQ页面
    url(r'^bindQQ/$',views.BindQQView.as_view(),name='bindQQ')
]
